package com.txm.service;

import com.github.pagehelper.Page;
import com.txm.dao.BaseDao;
import com.txm.model.Blog.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by Administrator on 2016/4/1.
 */
@Service
public class SysService {
    @Autowired
    private BaseDao baseDao;

    @Transactional
    public void articleAdd(Article article) {
        baseDao.merge(article);
    }

    @Transactional
    public Page<Article> articleList(Article article, Page<Article> articlePage) {
        return baseDao.page("from Article", articlePage);
    }
}